#include "StdAfx.h"
#include "Scene.h"

#include "SysSceneState.h"
#include "SysSceneMain.h"
#include "SysSceneMusic.h"
#include "SysSceneOption.h"
#include "SysSceneScore.h"
#include "SysSceneSelect.h"

#include "SysScene.h"

void SysScene::Init()
{
	nowState = SysSceneMain::Instance();
	nowState->EventReceiver(this);
}

void SysScene::Update(const KeyInput* input)
{
	nowState->Update(input);
}
void SysScene::Draw()
{
	nowState->Draw();
}
void SysScene::Reset()
{
	nowState->Reset();
}

void SysScene::OnEvent(GameBase* pObj, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if(uMsg == PRESSED)
	{
		switch(wParam)
		{
		case MAINMENU:
			nowState = SysSceneMain::Instance();
			nowState->Reset();
			break;
		case DIFFISELECT:
			nowState = SysSceneSelect::Instance();
			nowState->Reset();
			nowState->EventReceiver(this);
			break;
		case CHARSELECT:
			break;
		case OPTIONPAGE:
			break;
		case GAMELOADING:
			Event(GAMESCENE, lParam);
			break;
		default:
			break;
		}
	}
}